<?
        require_once '../Navigation/functions.php';
        require_once 'data.php';
        $section='Books';
        $result = GetAll();
?>

<!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Books</title>
    </head>
    
    <body>
                <? include("../Navigation/tabs.php"); ?>
        <h1>Books</h1>
        
        <table border="2">
        <td><a href="">Add</a></td> 
        </table>    
               
        <table border="2">
                <tr>
                <th>Title</th>
                
            </tr>
                        <? while($rs = $result->fetch_assoc()){ ?>
                <tr>
                        <td><?=$rs['Name']?></td>
                    <td>
                     <? if (IsAdmin()){ ?>
                        <a href="../Books/edit.php?id=<?=$rs['id']?>">Edit</a>
                        <a href="../Books/delete.php?id=<?=$rs['id']?>">Delete</a>
                     <? } ?>
                        <a href="details.php?id=<?=$rs['id']?>">View Details</a>
                    </td>
                </tr>
            <? } ?>
        </table>
    </body>
</html>